<?php
class ModelFidoPartner extends Model {
	public function getActivePartner() {
		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "partner p LEFT JOIN " . DB_PREFIX . "partner_description pd ON (p.partner_id = pd.partner_id) WHERE partner_active = '1' AND enabled='1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') ."'");
		return $query->rows;
	}

	public function getPartnerData($partner_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "partner p LEFT JOIN " . DB_PREFIX . "partner_description pd ON (p.partner_id = pd.partner_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.partner_id = '" . (int)$partner_id . "' ");
		return $query->row;
	}
	public function updateHits($partner_id) {
		$this->db->query("UPDATE " . DB_PREFIX . "partner SET hits = hits + 1 WHERE partner_id = '" . (int)$partner_id . "'");
	}
}
?>
